package top.leetcode;

/**
 * @Desc
 * @Author houruiyang
 * @Date 2022/12/21
 **/
public class _011 {

    public int maxArea(int[] height) {
        int i = 0, j = height.length - 1, res = 0;
        while (i < j) {
            res = height[i] < height[j] ?
                    Math.max(res, (j - i) * height[i++]) :
                    Math.max(res, (j - i) * height[j--]);
        }
        return res;
    }


}
